from django.db import models

# Create your models here.


#用户
class User(models.Model):

    username = models.CharField(max_length=32)
    password = models.CharField(max_length=128)
    img= models.ImageField(upload_to='img')
    name = models.CharField(max_length=32)
    sign = models.CharField(max_length=100)

    class Meta:
        db_table='user'


class Travels(models.Model):

    title = models.CharField(max_length=128)
    img = models.ImageField(upload_to='img')
    content = models.TextField()
    count = models.IntegerField(default=0)
    user = models.ForeignKey(User, on_delete=models.CASCADE)

    class Meta:
        db_table='travels'